<link href="__PUBLIC__/plugins/fitui/tablegrid.css" rel="stylesheet">
<link href="__PUBLIC__/themes/backend/group.css" rel="stylesheet">
<link href="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="__PUBLIC__/js/backend/format.js"></script>
<script src="__PUBLIC__/plugins/fitui/tablegrid.js"></script>
<script src="__PUBLIC__/js/backend/group.js"></script>
<script src="__PUBLIC__/js/backend/sys_user.js"></script>
<style type="text/css">

</style>
<script>
	var Param = <?php echo json_encode( $param ) ?>;
	$(function() {
		SysUser.init(<?php echo json_encode( $config ) ?>);
	});
</script>

<div class="page-content">
	<ol class="breadcrumb">
		<li><a href="<?php echo $home_url ?>">首页</a></li>
		<li class="active">
			<?php echo $module_name ?>
		</li>
	</ol>
	<div class="page-content-inner">
		<div class="portlet blue" id="read_modal">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-user "></i>
					<?php echo $module_name ?>
				</div>
				<div class="tools">
          <?php if ( $opt_data == 1 || in_array( '添加' , $opt_data ) ) : ?>
					<a href="#" class="toolbtn add load_add_modal_btn" data-toggle="tooltip" data-placement="top" title="新增"></a>
          <?php endif ; ?> 
				</div>
			</div>
			<div class="portlet-body ">

				<form class="form-inline" id="search_form" method="post">
					<div class="form-group" style="margin-bottom: 16px;">
						<label>关键字：</label> 
            <input id="keyword" placeholder="用户名 邮件 电话" type="text" class="form-control">
					</div>
					<div class="form-group" style="margin-bottom: 16px;">
						<label>角色：</label> 
              <select id="role_id" class="form-control">
							<option value="0" selected>不限</option>
							<?php echo form_options_rows( $param['role_data'] ,'id' , 'name' ) ?>
						</select>
					</div>
					<div class="form-group" style="margin-bottom: 16px;">
						<label>状态：</label> 
              <select id="status" class="form-control">
							<option value="0" selected>不限</option>
							<?php echo form_options( $param['status']  ) ?>
						</select>
					</div>
          <!-- 
					<div class="form-group" style="margin-bottom: 16px;">
						<label for="timeFrom">登陆时间：</label> 
            <input id="time_from" type="text" class="form-control dtp" placeholder="起始时间"> - 
            <input id="time_to" type="text" class="form-control dtp" placeholder="结束时间">
					</div>
          -->
					<div class="form-group" style="margin-bottom: 16px;">
						<button type="submit" class="btn btn-primary" id="search_btn"><i class="fa fa-search"> </i> 查询</button>
					</div>
				</form>
				<div class="table-responsive">

					<table id="data_table" class="table table-striped table-hover table-condensed">
						<thead>
							<tr>
								<th width="40" data-field="id" data-sortable="true">ID</th>
								<th width="160" data-field="username">用户名/角色</th>
								<th width="160" data-field="phone" data-formatter="format_phone" >手机</th>
                <th width="160" data-field="email" data-formatter="format_email" >电邮</th>
                <th width="60" data-field="status" data-formatter="format_status">状态</th>
								<th width="140" data-field="create_time" data-formatter="format_datetime">创建时间</th>
								<th width="140" data-field="last_login" data-formatter="format_datetime">最后登录</th>
								<?php if ( $opt_data == 1 || in_array( '重置密码' , $opt_data ) ) : ?><th width="80" data-formatter="opt_reset_pwd"></th><?php endif ; ?>
								<?php if ( $opt_data == 1 || in_array( '编辑' , $opt_data ) ) : ?><th width="80" data-formatter="opt_edit"></th><?php endif ; ?>
                <?php if ( $opt_data == 1 || in_array( '删除' , $opt_data ) ) : ?><th width="80" data-formatter="opt_delete"></th><?php endif ; ?>
								<th>&nbsp;</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- add_edit_model -->
<div class="modal fade" id="add_edit_modal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="action_label"></h4>
      </div>
      <div class="modal-body">
        <form id="submit_form" class="form-horizontal">
					<div class="form-group">
						<label class="col-sm-3 control-label">用户名</label>
						<div class="col-sm-7">
							<input name="username" type="text" class="form-control" placeholder="用户名" data-valid="required" data-tips="请填写正确的用户名">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">电子邮箱</label>
						<div class="col-sm-7">
							<input name="email" type="text" class="form-control" placeholder="电子邮箱">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">手机</label>
						<div class="col-sm-7">
							<input name="phone" type="text" class="form-control" placeholder="手机号">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">验证邮箱</label>
						<div class="col-sm-7">
  						<?php echo form_radios( 'email_verified' , $param['yesno'] ) ?>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">验证手机</label>
						<div class="col-sm-7">
  						<?php echo form_radios( 'phone_verified' , $param['yesno'] ) ?>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">状态</label>
						<div class="col-sm-7">
  						<?php echo form_radios( 'status' , $param['status'] ) ?>
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label">角色</label>
						<div class="col-sm-7">
              <?php echo form_checkbox_rows( 'role_id' , $param['role_data'] ) ?>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">用户组</label>
						<div class="col-sm-7" id="group_html">

						</div>
					</div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> 关闭</button>
        <button type="button" class="btn btn-primary" id="submit_btn"><i class="fa fa-check"></i> 提交</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /#add_edit_model -->

